Ext.define('DragonApp.store.Consumables', {
    extend: 'Ext.data.Store',

    alias: 'store.consumables',
    model: 'DragonApp.model.Consumables',
    proxy: {
        type: 'ajax',
        url: './resources/json/acc_dragon_prop.json',
        reader: {
            type: 'json',
            rootProperty: 'RECORDS'
        }
    },
    filters: [
        function(item) {
            return item.getData().type == '3';
        }
    ],
    autoLoad: true,

    listeners: {

        exception: function(proxy, response, operation) {
            DragonApp.util.Msg.showToast(response);
        },

        load: {
        /**
         *@example
         *var param = [
                {'store':Ext.create('DragonApp.store.Quality'),'field_s':'quality','field_m':'id','field_v':'name'},
                {'store':Ext.create('DragonApp.store.MonsterLocation'),'field_s':'location','field_m':'id','field_v':'name'}];

          var myFun = DragonApp.util.Util.transStore(param);
         * @type {Function}
         */
        fn: DragonApp.util.Util.transStore([
                { 'store': Ext.create('DragonApp.store.Quality'), 'field_s': 'quality', 'field_m': 'id', 'field_v': 'name' }])
        }
    }
});